#include "OpenCVView.h"

#include "renderwidget.h"
#include "ColourFilter.h"
#include "trackcontroller.h"
#include "processingthread.h"
#include "BlobFinder.h"
#include <QGridLayout>
#include <QSlider>
#include <QTimer>

OpenCVView::OpenCVView(QWidget *parent) : QWidget(parent) 
{
	render_widget = new RenderWidget(this);
	colour_filter = new ColourFilter();
	blob_finder = new BlobFinder();
	trackController = new TrackController();
	trackController->setRootFilter(colour_filter);	
	colour_filter->setListener(blob_finder);
	blob_finder->setListener(render_widget);


	QGridLayout *layout = new QGridLayout;
	
	layout->addWidget(render_widget, 0, 0);
	layout->addWidget(colour_filter->settings, 0, 1);
	layout->addWidget(blob_finder->settings, 1, 0);

	setLayout(layout);

	trackController->startTracking();
}

